<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core">
<h:head>
	<title>Spreadsheet2db</title>
</h:head>
<h:body>
	<h:outputStylesheet name="table-style.css" library="css" />
	<div id="container">
		<h1>Import Google Spreadsheet to database</h1>
		<h:outputText
			value="The spreadsheet #{importer.sheetName} from user #{importer.userName} was imported successfully" />
		<br />

		<table class="order-table">
			<tr>
<!-- 				<ui:repeat var="h" value="#{importer.header}"> -->
				<ui:repeat var="h" value="#{importer.spreadsheet.headerCells}">
					<th class="order-table-header">#{h.value}</th>	
				</ui:repeat>
			</tr>
			<tbody>
				<ui:repeat var="row" value="#{importer.spreadsheet.cells}" varStatus="rowStatus">
					<h:panelGroup rendered="#{rowStatus.index > 0}">
						<tr>
							<ui:repeat value="#{row}" varStatus="colStatus">
								<td class="order-table-even-row">#{importer.spreadsheet.cells[rowStatus.index][colStatus.index].value}</td>
				        	</ui:repeat>
						</tr>
					</h:panelGroup>
				</ui:repeat>
			</tbody>
		</table>

		<h:link value="Home" outcome="import" />
	</div>
</h:body>
</html>
